<template>
  <view class="">
    <u-collapse :value="activeKey">
      <u-collapse-item :title="item.title" name="1" v-for="(item, index) in collapseList" :key="index">
        <view class="">
          <u-list height="100%">
            <u-list-item v-for="(e, i) in item.contentList" :key="i">
              <u-cell :title="e.name" @click="details(e)">
                <clLcons slot="icon" :color="color" :type="e.icon" class="m-r-15"></clLcons>
                <clLcons slot="right-icon" :type="e.rightIcon" @click="iconClick(e)"></clLcons>
              </u-cell>
            </u-list-item>
          </u-list>
        </view>
      </u-collapse-item>
    </u-collapse>
    <u-toast ref="uToast"></u-toast>
  </view>
</template>

<script>
import { informationListArrOne } from "./utils/list";
import clLcons from "@/components/cl-icon/cl-icon.vue";
export default {
  data() {
    return {
      collapseList: null,
      color:'#3d7ff7',
      activeKey: ["1"]
    };
  },
  components: {
    clLcons,
  },
  mounted() {
    this.collapseList = informationListArrOne;
  },
  methods: {
    details(item) {
      if (!item.route) {
        this.$refs.uToast.show({
          type: 'default',
          message: '正在开发中',
        })
        return
      }
      this.$Router.push({
        name: item.route,
      });
    },
    iconClick(item) {
      if (!item.rightRoute) {
        this.$refs.uToast.show({
          type: 'default',
          message: '正在开发中',
        })
        return
      }
      this.$Router.push({
        path: item.rightRoute,
      });
    },
    btnListSaleOrder() {
      // console.log("btnListSaleOrder");
      this.$Router.push({
        name: "SaleOrderList",
      });
    },
    btnPrintLabel() {
      // console.log("btnPrintLabel");
      this.$Router.push({
        name: "GoodsLabel",
      });
    },
  },
};
</script>

<style></style>
